#ifndef FILEIO_H
#define FILEIO_H
#include<windows.h>
#include <fstream>
#include <sstream>
#include <iostream>
#include <vector>
#include <QtWidgets>
#include <QMainWindow>

class dealBMP {
private:
    BYTE* m_picA=nullptr;
    uchar* m_ptr=nullptr;
	int bmpW;
	int bmpH;
	int maxGray;
	int minGray;
    int bitCount;
    const char* filePic;
    //FILE* binFile=nullptr;
public:
	dealBMP(const char* filename);
    dealBMP(const char* filename, int& picW, int& picH);
    dealBMP(BYTE* pic,int& picW,int& picH,int B);
    ~dealBMP();
    bool writePic2(BYTE** pic, int biBitCount);//写出二维数组bmp
    bool writePic1(BYTE* pic, int biBitCount);
	int picWidth();
	int picHeight();
	int maxG();
	int minG();
    int bitOut();
    BYTE* pic();
    uchar* ptr(int& smallW,int& smallH);
};
//bool RmwWriteByteImg2BmpFile(BYTE** pic,long width, long height, const char* filename);
#endif
